package com.yuke.cloud.service.cmc.controller.frontend;

import com.yuke.cloud.common.core.support.BaseController;
import com.yuke.cloud.common.util.wrapper.WrapMapper;
import com.yuke.cloud.common.util.wrapper.Wrapper;
import com.yuke.cloud.service.cmc.entity.CmsAppNavi;
import com.yuke.cloud.service.cmc.service.CmsAppNaviService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/*
 * <p>Company: Copyright (c) 2018. yuke All Rights Reserved. </br> </p>
 * <p>Title：yukemall </br> </p>
 * <p>com.yuke.cloud.service.cmc.controller.frontend Description TODO </br> </p>
 * @Author wg
 * @Date   2019/6/6 15:49
 */
@Api(value = "WEB - MallCmsAppNaviController", tags = "处理CmsNavi相关请求", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RestController
@RequestMapping("/mall/cms/app_navi")
public class MallCmsAppNaviController extends BaseController {

    @Resource
    private CmsAppNaviService cmsAppNaviService;

    @GetMapping("/getAppNavi")
    @ApiOperation(httpMethod = "GET", value = "获取APP导航栏信息")
    public Wrapper<List<CmsAppNavi>> getAppNavis(@ApiParam(name = "naviType", value = "naviType") @RequestParam(required = false) Byte naviType) {
        List<CmsAppNavi> cmsAppNavis = cmsAppNaviService.getAppNavis(naviType);

        return WrapMapper.ok(cmsAppNavis);
    }
}
